﻿@model Easy.CMS.Article.ViewModel.ArticleListWidgetViewModel
@{
    if (!Model.Widget.DetailPageUrl.IsNullOrEmpty())
    {
        Model.Widget.DetailPageUrl = Url.Content(Model.Widget.DetailPageUrl);
    }
}
<div class="article-list container-fluid">
    @if (Model.Articles != null)
    {
        <div class="row">
            <div class="col-sm-12">
                <ul class="media-list">
                    @foreach (var item in Model.Articles)
                    {
                        <li class="media">
                            <div class="media-left">
                                <a href="@Url.PostUrl(Model.Widget.DetailPageUrl,item.ID.ToString())">
                                    <img class="media-object" src="@Url.PathContent(item.ImageThumbUrl)" alt="@item.Title">
                                </a>
                            </div>
                            <div class="media-body">
                                <h4 class="media-heading">
                                    <a href="@Url.PostUrl(Model.Widget.DetailPageUrl,item.ID.ToString())">
                                        @item.Title
                                    </a>
                                </h4>
                                @item.Summary
                            </div>
                        </li>
                    }
                </ul>
                @if (Model.IsPageable)
                {
                    Html.Pagin(Model.Pagin);
                }
            </div>
        </div>
    }
</div>
